package com.supor.aiot.md_msg.api;

import com.android.baseconfig.base.BaseApiResult;
import com.supor.aiot.common.app.Constants;
import com.supor.aiot.common.entity.Result;
import com.supor.aiot.md_msg.entity.MsgCenterListResultBean;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * @author: zook
 * @date: 2021/10/14
 */
public interface MsgCenterApiService {

    @GET(Constants.OSS_API + "bossTUserMessage/page")
    Observable<BaseApiResult<MsgCenterListResultBean>> getMsgList(@Query("bossUserId") String bossUserId,
                                                                  @Query("messageType") String messageType,
                                                                  @Query("orderby") String orderby,
                                                                  @Query("limit") int limit,
                                                                  @Query("page") int page
    );

    @GET(Constants.OSS_API + "bossTUserMessage/page")
    Observable<BaseApiResult<MsgCenterListResultBean>> getMsgListUnReadCount(@Query("bossUserId") String bossUserId,
                                                                             @Query("messageType") String messageType,
                                                                             @Query("orderby") String orderby,
                                                                             @Query("isRead") int isRead,
                                                                             @Query("limit") int limit,
                                                                             @Query("page") int page
    );

    //    收到的评论：bossTUserMessage/page?note=REPLY&messageType=COMMUNITY
//    收到的点赞：bossTUserMessage/page?note=LIKE&messageType=COMMUNITY
    @GET(Constants.OSS_API + "bossTUserMessage/page")
    Observable<BaseApiResult<MsgCenterListResultBean>> getReplyMsgList(@Query("bossUserId") String bossUserId,
                                                                       @Query("note") String note,
                                                                       @Query("messageType") String messageType,
                                                                       @Query("orderby") String orderby,
                                                                       @Query("limit") int limit,
                                                                       @Query("page") int page
    );

    @GET(Constants.OSS_API + "bossTUserMessage/page")
    Observable<BaseApiResult<MsgCenterListResultBean>> getLikeMsgList(@Query("bossUserId") String bossUserId,
                                                                      @Query("note") String note,
                                                                      @Query("messageType") String messageType,
                                                                      @Query("orderby") String orderby,
                                                                      @Query("limit") int limit,
                                                                      @Query("page") int page
    );

    @GET(Constants.OSS_API + "bossTUserMessage/page")
    Observable<BaseApiResult<MsgCenterListResultBean>> getReplyMsgListUnreadNum(@Query("bossUserId") String bossUserId,
                                                                                @Query("note") String note,
                                                                                @Query("messageType") String messageType,
                                                                                @Query("orderby") String orderby,
                                                                                @Query("isRead") int isRead,
                                                                                @Query("limit") int limit,
                                                                                @Query("page") int page
    );

    @GET(Constants.OSS_API + "bossTUserMessage/page")
    Observable<BaseApiResult<MsgCenterListResultBean>> getLikeMsgListUnreadNum(@Query("bossUserId") String bossUserId,
                                                                               @Query("note") String note,
                                                                               @Query("messageType") String messageType,
                                                                               @Query("orderby") String orderby,
                                                                               @Query("isRead") int isRead,
                                                                               @Query("limit") int limit,
                                                                               @Query("page") int page
    );

    //    isRead	已读标识
//    isDel	删除标识
    @GET(Constants.OSS_API + "bossTUserMessage/allReadOrDel")
    Observable<BaseApiResult<String>> cleanRead(@Query("isRead") int isRead);

    //    isRead	已读标识
//    isDel	删除标识
    @GET(Constants.OSS_API + "bossTUserMessage/allReadOrDel")
    Observable<BaseApiResult<String>> delAllMsg(@Query("isDel") int isDel);


    /**
     * 已读
     *
     * @param id
     * @return
     */
    @POST(Constants.OSS_API + "bossTUserMessage/update/{id}")
    Observable<BaseApiResult<String>> msgRead(@Path("id") String id,
                                              @Body RequestBody requestBody);

    /**
     * 已读
     *
     * @param id
     * @return
     */
    @GET(Constants.OSS_API + "bossTUserMessage/updateData/{id}?isDel=1")
    Observable<BaseApiResult<String>> delMsg(@Path("id") String id);


}
